package com.dzl.constant;

import com.dzl.config.ApplicationConfiguration;

/**
 * 福禄
 * @author WangJian
 * @date 2021/7/30 0030
 */
public class ApiFuLuConstant {

    //直充下单接口
    public static final String URL = getUrl();
    //商户号
//    public static final String MERCHANT_ID = getMerchantId();
    //APP_KEY  商户号
    public static final String APP_KEY = getKey();
    //秘钥
    public static final String SYS_SECRET = getSecret();
    //卡密下单接口method方法
    public static final String OPEN_API_CARD_ORDER_ADD = "fulu.order.card.add";
    // 根据话费查询归属地和城市编码，面值，城市等信息
    public static final String OPEN_API_CHECK_PHONE = "fulu.mobile.info.get";
    // 直充下单接口method方法
    public static final String OPEN_API_DIRECT_ORDER_ADD = "fulu.order.direct.add";
    // 获取商品列表接口method方法
    public static final String OPEN_API_GOODS_LIST_GET = "fulu.goods.list.get";
    // 获取商品信息接口method方法
    public static final String OPEN_API_GOODS_GET = "fulu.goods.info.get";
    // 获取商品模板信息接口method方法
    public static final String OPEN_API_GOODS_TEMPLATE_GET = "fulu.goods.template.get";
    // 查单接口method方法
    public static final String OPEN_API_ORDER_GET = "fulu.order.info.get";
    // 话费下单接口method方法
    public static final String OPEN_API_PHONE_ORDER_ADD = "fulu.order.mobile.add";
    // 流量下单接口method方法
    public static final String OPEN_API_TRAFFIC_ORDER_ADD = "fulu.order.data.add";
    // 获取用户信息接口method方法
    public static final String OPEN_API_USER_INFO_GET = "fulu.user.info.get";

    /**
     * 获取API地址 正式服or测试服
     * @date 2021/7/14 0014 11:44
     * @author wangjian
     * @param
     * @return java.lang.String
     */
    public static String getUrl() {
        String isProduct = ApplicationConfiguration.getInstance().getIsProduct();
        if (isProduct == null || "0".equals(isProduct)) {
            System.out.println("getUrl: " + isProduct);
            return "http://pre.openapi.fulu.com/api/getway";
        } else {
            return "http://openapi.fulu.com/api/getway";
        }
    }

    /**
     * 获取KEY 正式服or测试服
     * @date 2021/7/14 0014 11:44
     * @author wangjian
     * @param
     * @return java.lang.String
     */
    public static String getKey() {
        String isProduct = ApplicationConfiguration.getInstance().getIsProduct();
        if (isProduct == null || "0".equals(isProduct)) {
            System.out.println("getKey: " + isProduct);
            return "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
        } else {
            return "i3X0m3EFrmQHaJl8SY2nZG9xWAf3ZWeP+X1OG48V+yw+zSTE45JOdmWbc1wYwx4x";
        }
    }

    /**
     * 获取Secret 正式服or测试服
     * @date 2021/7/14 0014 11:44
     * @author wangjian
     * @param
     * @return java.lang.String
     */
    public static String getSecret() {
        String isProduct = ApplicationConfiguration.getInstance().getIsProduct();
        if (isProduct == null || "0".equals(isProduct)) {
            System.out.println("getSecret: " + isProduct);
            return "0a091b3aa4324435aab703142518a8f7";
        } else {
            return "597ca62e89ed4acd92008b741698eff3";
        }
    }

//    /**
//     * 商户号
//     * @date 2021/7/30 0030 9:55
//     * @author wangjian
//     * @param
//     * @return java.lang.Integer
//     */
//    public static String getMerchantId() {
//        String isProduct = ApplicationConfiguration.getInstance().getIsProduct();
//        if (isProduct == null || "0".equals(isProduct)) {
//            System.out.println("getMerchantId: " + isProduct);
//            return "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
//        } else {
//            return "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
//        }
//    }
}
